#!/bin/bash

# 向量库操作系统启动脚本

echo "🚀 启动向量库操作系统..."
echo "================================"

# 检查Python环境
if ! command -v python &> /dev/null; then
    echo "❌ Python未安装，请先安装Python 3.9+"
    exit 1
fi

# 检查conda环境
if command -v conda &> /dev/null; then
    echo "📦 检测到conda环境"
    if conda info --envs | grep -q "vector-system"; then
        echo "✅ 激活conda环境: vector-system"
        conda activate vector-system
    else
        echo "⚠️  未找到vector-system环境，请先创建："
        echo "   conda create -n vector-system python=3.9"
        echo "   conda activate vector-system"
        echo "   python vector_system/setup.py"
    fi
fi

# 检查依赖
echo "🔍 检查系统依赖..."
python test_system.py

# 启动系统
echo "🚀 启动Web服务..."
python 向量库操作.py
